using System;
using System.Data.Linq.Mapping;
using System.Runtime.Serialization;

namespace Portal.Data.Entity
{
    [Table(Name = "dbo.PortalObject"), Serializable, DataContractAttribute]
    public class PortalObject : BaseObject
    {
        #region Properties
        [ColumnAttribute(Name = "Object_ID", IsPrimaryKey = true, IsDbGenerated = true)]
        public long ID { get; set; }

        /*
        [ColumnAttribute(Name = "CreatedAt")]
        public DateTime CreatedAt { get; set; }

        [ColumnAttribute(Name = "CreatedBy")]
        public int? CreatedBy { get; set; }

        [ColumnAttribute(Name = "ModifiedBy")]
        public int? ModifiedBy { get; set; }

        [ColumnAttribute(Name = "ModifiedAt")]
        public DateTime ModifiedAt { get; set; }
        */

        #endregion

        #region Methods
        public static PortalObject FindByPrimaryKey(object objectid)
        {
            return FindByPrimaryKey<PortalObject>(objectid);
        }
        public static Int64 CreateNew()
        {
            var obj = new PortalObject();
            obj.SaveWithoutPermission();
            return obj.ID;
        }
        #endregion Methods
    }
}
